package test

import (
	"answer5/adb"
	"answer5/quark"
	"answer5/unti"
	"answer5/xiGua"
)

var(
	questionImagePath = `D:\DownLoad\MEmu\answer\answer-xy.jpg`
	resultImagePath = `answer-result.jpg`
)

func TestRandomOptions(){
	xiguaOptions := []*[]string{
		{"始建于隋朝","属于钢筋斜拉桥","设计建造者李春"},
		{"是一座石拱桥","坐落于北京永定河之上","设计建造者李春"},
		{"设计建造者李春","坐落于北京永定河之上", "始建于隋朝"},
		{"是一座石拱桥","设计建造者李春","属于钢筋斜拉桥"},
		{"是一座石拱桥", "设计建造者李春","坐落于北京永定河之上"},
		{"是一座石拱桥","设计建造者李春","坐落于北京永定河之上"},
		{"坐落于北京永定河之上","设计建造者李春","是一座石拱桥"},
		{"属于钢筋斜拉桥","设计建造者李春","始建于隋朝"},
		{"始建于隋朝","属于钢筋斜拉桥", "设计建造者李春"},
	}
	xiguaOptions2 := []*[]string{
		{"A","B","C"},
		{"B","E","A"},
		{"I","E", "B"},
		{"D","C","E"},
		{"A", "E","D"},
		{"F","A","E"},
		{"E","F","C"},
		{"H","A","C"},
		{"C","H", "E"},
	}
	unti.RandomOptions(&xiguaOptions)
	unti.RandomOptions(&xiguaOptions2)
}

func TestImg(){
	_questionTitle := "数学符号Rt△，所代表的意义是什么？"
	_options := []string{"锐角三角形","直角三角形","钝角三角形"}

	//截屏
	//_img,_:=adb.GetSnapshot()
	//adb.SaveImage(&resultImagePath,_img)

	//产生问题图片
	_img := adb.CreateQuestionImage(&_questionTitle,&_options)
	adb.SaveImage(&questionImagePath,_img)
}

func TestXiaoYuan(){
	_questionTitle := "数学符号Rt△，所代表的意义是什么？"
	_options := []string{"锐角三角形","直角三角形","钝角三角形"}

	adb.Restart()

	_img := adb.CreateQuestionImage(&_questionTitle,&_options)
	adb.SaveImage(&questionImagePath,_img)

	//再拍一张
	adb.AdbShellInputTap(500,1250)
	adb.TimeSleepDuration(100)
	//选择相册
	adb.AdbShellInputTap(45,1240)
	adb.TimeSleepDuration(100)
	//图片
	adb.AdbShellInputTap(200,135)
	adb.TimeSleepDuration(100)
}

func TestXiGuaNewQuestion(){
	isStart := true
	xiGua.IsTest=true
	xiGua.Start(&isStart)
}

func TestKuaiShouNewQuestion(){
	isStart := true
	app:="kuaiShou"
	quark.IsTest=true
	quark.Start(&isStart,&app)
}

func TestClick(){
	adb.Restart()
	//再拍一张
	adb.AdbShellInputTap(500,1250)
	adb.TimeSleepDuration(1)
	//选择相册
	adb.AdbShellInputTap(45,1240)
	adb.TimeSleepDuration(1)
	//图片
	adb.AdbShellInputTap(200,135)
	adb.TimeSleepDuration(1)
}